﻿using Db7;
using System.Collections;
using System;

#if SCRIPTSHARP
using Db7.SS;
#else
using System.Web.Script.Serialization;
#endif

namespace Db7_ut.DomainObjects
{
    public class Employee
    {
        public StringBinder IDB;
        
        public string ID
        {
            get { return StringBinder.Get(IDB); }
            set { IDB = StringBinder.Set(IDB, value); }
        }

        public IntBinder AgeDB;

        public int Age
        {
            get { return IntBinder.Get(AgeDB); }
            set { AgeDB = IntBinder.Set(AgeDB, value); }
        }

        public void Save(Action callBack)
#if SCRIPTSHARP
        {
            RemoteCallSettings rcs = new RemoteCallSettings(this);
            rcs.PreserveState = true;
            Remote.Invoke(rcs);
            
        }
#else
        {
            this.ID = this.ID + " I was here";
        }
#endif

    }
}
